<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<script src="js/jquery.min.js"></script>
	<body>
		<h1>写死json,解析json字符串把价格和ID展现页面</h1>
		<div>
			<div id="">编号:<span id="itemId"></span></div>
			<div>价格:<span id="itemPrice"></span></div>
		</div>
	</body>
	<script type="text/javascript">
		var jsonstr='[{"p":"4399.00","op":"4399.00","cbf":"0","id":"J_100016367012","m":"4899.00"}]'
		console.log(jsonstr);
		//这是一个字符串,怎样跳出p和id
		//json浏览器直接支持技术,json
		var items=JSON.parse(jsonstr);
		console.log(items[0]);
		console.log(items[0].p);
		console.log(items[0].id);
		
		$("#itemId").text(items[0].id);
		$("#itemId").css("color","blue")
		$("#itemPrice").text(items[0].p);
		$("#itemPrice").css("color","red");
	</script>
</html>
